package com.thread;

import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class JUC_FutureTask_29 {

    public static void main(String[] args) throws ExecutionException, InterruptedException {
        FutureTask<Integer> task = new FutureTask<>(()->{
            return 100;
        });

        new Thread(task).start();;

        System.out.println(task.get());//阻塞
    }
}
